package com.jxc.JSTL;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

@WebServlet("/notice")
public class NoticeServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        List<Notice> notices = new ArrayList<>();
        notices.add(new Notice("1","好好学习，天天向上"));
        notices.add(new Notice("2","java web 开发"));
        notices.add(new Notice("3","java工程师"));
        req.setAttribute("notices",notices);
        req.getRequestDispatcher("/notice.jsp").forward(req,resp);
    }
}
